import sqlite3

conn = sqlite3.connect('database.db')
cursor = conn.cursor()

# 检查表结构
cursor.execute('SELECT name FROM sqlite_master WHERE type="table"')
tables = cursor.fetchall()

print('数据库表结构:')
for table in tables:
    print(f'- {table[0]}')
    
    # 检查每个表的结构
    cursor.execute(f'PRAGMA table_info({table[0]})')
    columns = cursor.fetchall()
    print('  列:')
    for column in columns:
        print(f'  - {column[1]} ({column[2]})')

cursor.close()
conn.close()